package com.ruoyi.shopping.service.impl;

import java.util.ArrayList;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.order.domain.StoreProductOrderHandle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shopping.mapper.MallCdkMapper;
import com.ruoyi.shopping.domain.MallCdk;
import com.ruoyi.shopping.service.IMallCdkService;

/**
 * 批量生成CDKService业务层处理
 *
 * @author ruoyi
 * @date 2022-07-18
 */
@Service
public class MallCdkServiceImpl implements IMallCdkService
{
    @Autowired
    private MallCdkMapper mallCdkMapper;

    /**
     * 查询批量生成CDK
     *
     * @param id 批量生成CDK主键
     * @return 批量生成CDK
     */
    @Override
    public MallCdk selectMallCdkById(Long id)
    {
        return mallCdkMapper.selectMallCdkById(id);
    }

    /**
     * 查询批量生成CDK列表
     *
     * @param mallCdk 批量生成CDK
     * @return 批量生成CDK
     */
    @Override
    public List<MallCdk> selectMallCdkList(MallCdk mallCdk)
    {
        return mallCdkMapper.selectMallCdkList(mallCdk);
    }

    /**
     * 新增批量生成CDK
     *
     * @param mallCdk 批量生成CDK
     * @return 结果
     */
    @Override
    public int insertMallCdk(MallCdk mallCdk)
    {
        mallCdk.setCreateTime(DateUtils.getNowDate());
        return mallCdkMapper.insertMallCdk(mallCdk);
    }

    /**
     * 修改批量生成CDK
     *
     * @param mallCdk 批量生成CDK
     * @return 结果
     */
    @Override
    public int updateMallCdk(MallCdk mallCdk)
    {
        mallCdk.setUpdateTime(DateUtils.getNowDate());
        return mallCdkMapper.updateMallCdk(mallCdk);
    }

    /**
     * 批量删除批量生成CDK
     *
     * @param ids 需要删除的批量生成CDK主键
     * @return 结果
     */
    @Override
    public int deleteMallCdkByIds(Long[] ids)
    {
        return mallCdkMapper.deleteMallCdkByIds(ids);
    }


    /**
     * 批量逻辑删除批量生成CDK
     *
     * @param ids 需要删除的批量生成CDK主键
     * @return 结果
     */
    @Override
    public int logicDeleteMallCdk(Long[] ids,String delType,Long delUser)
    {
        return mallCdkMapper.logicDeleteMallCdk(ids,delType,delUser);
    }

    /**
     * 删除批量生成CDK信息
     *
     * @param id 批量生成CDK主键
     * @return 结果
     */
    @Override
    public int deleteMallCdkById(Long id)
    {
        return mallCdkMapper.deleteMallCdkById(id);
    }

//    @Override
//    public void insertMallCdks(ArrayList<MallCdk> list) {
//
//    }
    @Override
    public void insertMallCdks(ArrayList<MallCdk> list) {
        mallCdkMapper.insertMallCdks(list);
    }
    @Override
    public MallCdk selectByCdk(String cdk) {
        return mallCdkMapper.selectByCdk(cdk);
    }
}
